package com.fzkj.bio.part1;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

/**
 * 客户端
 */
public class Client {

    public static void main(String[] args) {
        //
        try {
            // 创建socket对象
            Socket s = new Socket("127.0.0.1", 2323);
            // 获取输出流
            OutputStream os = s.getOutputStream();
            // 将字节输出流包装成打印流
            PrintWriter pw = new PrintWriter(os);
            pw.println("hello world!");
            pw.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
